/*************************************************************************
 *  Copyright (C), 2017-2018, Mogoson tech. Co., Ltd.
 *  FileName: CubeArea.cs
 *  Author: Mogoson   Version: 1.0   Date: 7/11/2017
 *  Version Description:
 *    Internal develop version,mainly to achieve its function.
 *  File Description:
 *    Ignore.
 *  Class List:
 *    <ID>           <name>             <description>
 *     1.           CubeArea               Ignore.
 *  Function List:
 *    <class ID>     <name>             <description>
 *     1.
 *  History:
 *    <ID>    <author>      <time>      <version>      <description>
 *     1.     Mogoson     7/11/2017       1.0        Build this file.
 *************************************************************************/

namespace Developer.AreaRoam
{
    using UnityEngine;

    [AddComponentMenu("Developer/AreaRoam/CubeArea")]
    public class CubeArea : Area
    {
        #region Property and Field
        /// <summary>
        /// Area radius.
        /// </summary>
        public Vector3 radius = Vector3.one;
        #endregion

        #region Public Method
        /// <summary>
        /// Get point in area.
        /// </summary>
        /// <returns>Point in area</returns>
        public override Vector3 GetPoint()
        {
            return transform.TransformPoint(new Vector3(Random.Range(-radius.x, radius.x), 
                Random.Range(-radius.y, radius.y), Random.Range(-radius.z, radius.z)));
        }
        #endregion
    }//class_end
}//namespace_end